Your SlideShare is downloading. ×

Unity Programing on Boo

22,137

Published on

It describes how to programming on Boo. …

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
22,137
On Slideshare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
20
Comments
0
Likes
7
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Unity Programming on Boo2011/11/5( )@shinriyo : (2011/6/23)
  • 2. BooPython https://github.com/bamboo & Rodrigo B. De Oliveira Unity
  • 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. ;Input.ResetInputAxes() :def Update ():
  • 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. Vector3 OKvar aPosition : Vector3; USaPosition.x = 1;aPosition as Vector3 BooaPosition.x = 1
  • 7. float singledef HogeMethod (hoge as single): Debug.Log (hoge )
  • 8. .boo.py
  • 9. Unity Script( US) [][RequireComponent(CharacterController)] Boo@script RequireComponent(CharacterController) US
  • 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. publicvar walkSpeed = 2.0; USpublic walkSpeed = 2.0 Boo
  • 12. C#class ThirdPersonController(MonoBehaviour): US
  • 13. ifif IsGrounded():elif IsGrounded(): else if
  • 14. # ANIMATION sector// Set rotation to the move direction/* do something*/ Apply gravity- extra power jump modifies gravity- controlledDescent mode modifies gravity
  • 15. def Start (): pass def Start ():! hoge + bar pass
  • 16. private _characterState as CharacterStatedef CalculateJumpVerticalSpeed (targetJumpHeight as float): selfdef CalculateJumpVerticalSpeed (self, targetJumpHeight as float): BCE0043: Unexpected token: self.
  • 17. HogeClass.StaticMethod()public static def StaticMethod(): !Debug.Log("StaticMethod") HogeClass
  • 18. || &&if moveSpeed < walkSpeed * 0.9 and grounded or hoge: && and 1
  • 19. if hoge: something # 2 aaa #if fuga: something # 4 Python bar # 3 4

×