Unity Programing on Boo

26,527 views

Published on

It describes how to programming on Boo.
Boo is cool language of Unity than Unity Script.

Published in: Technology, Business
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
26,527
On SlideShare
0
From Embeds
0
Number of Embeds
20,977
Actions
Shares
0
Downloads
21
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide

Unity Programing on Boo

  1. 1. Unity Programming on Boo2011/11/5( )@shinriyo : (2011/6/23)
  2. 2. BooPython https://github.com/bamboo & Rodrigo B. De Oliveira Unity
  3. 3. import UnityEngineclass GameZombie (MonoBehaviour): public SomeWhiteTexture as Texture private hot as bool = true private cameraFlg as bool = true private isOver as bool = false def ApplyDamage (damage as int): Destroy(self) https://market.android.com/details?id=com.shinriyo.tsuminbie def Start (): animation.Play("Zombie Walk");
  4. 4. ;Input.ResetInputAxes() :def Update ():
  5. 5. (list comprehensions) OKimport UnityEngineclass NewBehaviourScript (MonoBehaviour): doubles as List def Start (): doubles = [i*2 for i in range(5)] def Update (): 0 for dbl in doubles: 2 Debug.Log(dbl) 4 6 8
  6. 6. Vector3 OKvar aPosition : Vector3; USaPosition.x = 1;aPosition as Vector3 BooaPosition.x = 1
  7. 7. float singledef HogeMethod (hoge as single): Debug.Log (hoge )
  8. 8. .boo.py
  9. 9. Unity Script( US) [][RequireComponent(CharacterController)] Boo@script RequireComponent(CharacterController) US
  10. 10. function Do () { print("Do now"); US yield WaitForSeconds (2); print("Do 2 seconds later");} def Do() as IEnumerator: print(Do now) yield WaitForSeconds(2) C# print(Do 2 seconds later) IEnumerator Do() { print("Do now"); Boo yield return new WaitForSeconds(2); print("Do 2 seconds later"); }
  11. 11. publicvar walkSpeed = 2.0; USpublic walkSpeed = 2.0 Boo
  12. 12. C#class ThirdPersonController(MonoBehaviour): US
  13. 13. ifif IsGrounded():elif IsGrounded(): else if
  14. 14. # ANIMATION sector// Set rotation to the move direction/* do something*/ Apply gravity- extra power jump modifies gravity- controlledDescent mode modifies gravity
  15. 15. def Start (): pass def Start ():! hoge + bar pass
  16. 16. private _characterState as CharacterStatedef CalculateJumpVerticalSpeed (targetJumpHeight as float): selfdef CalculateJumpVerticalSpeed (self, targetJumpHeight as float): BCE0043: Unexpected token: self.
  17. 17. HogeClass.StaticMethod()public static def StaticMethod(): !Debug.Log("StaticMethod") HogeClass
  18. 18. || &&if moveSpeed < walkSpeed * 0.9 and grounded or hoge: && and 1
  19. 19. if hoge: something # 2 aaa #if fuga: something # 4 Python bar # 3 4

×